<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>焦点事件</title>
    <script>
        window.onload=function(){
            document.getElementsByClassName('username')[0];
            username.onfocus=function(e){
                alert('asdf');
            }
            username.onblur=function(e){
                alert('jlakjdf;1')
            }
        }
    
    </script>
</head>
<body>
    <div class="messge"></div>
    <div class="login">

        <label
    </div>
      
    

    <input type="text" class="username">
    
</body>
</html>